import { BaseEntity } from '@libs/common/entities';
import { ApiProperty } from '@nestjs/swagger';
import { Column, Entity } from 'typeorm';

@Entity('crm_node_atm_device_exchange_log')
export class DeviceExchangeLog extends BaseEntity {
  @ApiProperty({ description: '领用用户ID' })
  @Column({ comment: '领用用户ID' })
  userId: string;

  @ApiProperty({ description: '领用用户名称' })
  @Column({ comment: '领用用户名称' })
  userName: string;

  @ApiProperty({ description: '商品ID' })
  @Column({ comment: '商品ID' })
  productId: string;

  @ApiProperty({ description: '商品名称' })
  @Column({ comment: '商品名称' })
  productName: string;

  @ApiProperty({ description: '商品价格' })
  @Column('double', { comment: '商品价格' })
  productPrice: number;

  @ApiProperty({ description: '商品数量' })
  @Column({ comment: '商品数量' })
  productNumber: number;

  @ApiProperty({ description: '订单编号' })
  @Column({ comment: '订单编号', unique: true })
  orderNo: string;

  @ApiProperty({ description: '订单状态: 0-待出货，1-已出货，-1-已取消' })
  @Column({ comment: '订单状态: 0-待出货，1-已出货，-1-已取消' })
  orderStatus: 0 | 1 | -1;

  @ApiProperty({ description: '流水号' })
  @Column({ comment: '流水号', unique: true })
  deviceTransNo: string;

  @ApiProperty({ description: '货道ID' })
  @Column({ comment: '货道ID' })
  deviceRoadId: string;

  @ApiProperty({ description: '货道号' })
  @Column({ comment: '货道号' })
  deviceRoadNo: string;

  @ApiProperty({ description: '出货结果: 0-待出货，1-成功，-1-失败' })
  @Column({ comment: '出货结果: 0-待出货，1-成功，-1-失败' })
  deviceResult: 0 | 1 | -1;
}
